package com.codechuan.hallo_web.controller;

import com.codechuan.hallo_web.service.BlApiService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * @Deprecated 百里项目接口
 */
@RestController
@RequestMapping(value = "/bl")
public class BlApiController {

    @Resource
    private BlApiService blApiService;

    /**
     * @param hashMap 参数
     * @return 返回成功或者失败的消息
     * @Deprecated 登录接口
     */
    @PostMapping(value = "/loginBl")
    public String loginJt(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.login(hashMap);
    }

    /**
     * @param hashMap 参数
     * @return 返回成功或者失败的消息
     * @Deprecated 注册用户
     */
    @PostMapping(value = "/registerUser")
    public String registerUser(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.registerUser(hashMap);
    }

    /**
     * @param hashMap 参数
     * @return 返回用户配置文件
     * @Deprecated 读取用户配置
     */
    @PostMapping(value = "/selectUserConfig")
    public String selectUserConfig(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.selectUserConfig(hashMap);
    }


    /**
     * @param hashMap 参数
     * @return 返回token集合
     * @Deprecated 读取用户token列表
     */
    @PostMapping(value = "/getUserTokenList")
    public String getUserTokenList(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.getUserTokenList(hashMap);
    }

    /**
     * @param hashMap 参数
     * @return 返回城市编码
     * @Deprecated 获取排除城市编码
     */
    @PostMapping(value = "/selectPcCsCityCode")
    public String selectPcCsCityCode(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.selectPcCsCityCode(hashMap);
    }


    /**
     * @param hashMap 参数
     * @Deprecated 保存配置文件
     */
    @PostMapping(value = "/saveUserConfig")
    public String saveUserConfig(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.saveUserConfig(hashMap);
    }

    /**
     * @param hashMap 参数
     * @Deprecated 新增一条用户token
     */
    @PostMapping(value = "/insertUserToken")
    public String insertUserToken(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.insertUserToken(hashMap);
    }

    /**
     * @param hashMap 参数
     * @Deprecated 修改token状态
     */
    @PostMapping(value = "/updateUserTokenStatus")
    public String updateUserTokenStatus(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.updateUserTokenStatus(hashMap);
    }

    /**
     * @param hashMap 参数
     * @Deprecated 删除小号token
     */
    @PostMapping(value = "/deleteUserMinToken")
    public String deleteUserMinToken(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.deleteUserMinToken(hashMap);
    }


    /**
     * @param hashMap 参数
     * @Deprecated 获取订单列表
     */
    @PostMapping(value = "/getUserOrderList")
    public String getUserOrderList(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.getUserOrderList(hashMap);
    }

    /**
     * @param hashMap 参数
     * @Deprecated 新增用户订单
     */
    @PostMapping(value = "/addUserOrder")
    public String addUserOrder(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.addUserOrder(hashMap);
    }

    /**
     * @param hashMap 参数
     * @Deprecated 删除指定订单信息
     */
    @PostMapping(value = "/deleteOrderInfo")
    public String deleteOrderInfo(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.deleteOrderInfo(hashMap);
    }

    /**
     * @param hashMap 参数
     * @Deprecated 删除所有订单信息
     */
    @PostMapping(value = "/deleteAllOrderByAccount")
    public String deleteAllOrderByAccount(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.deleteAllOrderByAccount(hashMap);
    }

    /**
     * @param hashMap 参数
     * @Deprecated 解绑账号
     */
    @PostMapping(value = "/noBind")
    public String noBind(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.noBind(hashMap);
    }

    /**
     * @param hashMap 参数
     * @Deprecated 解绑账号
     */
    @PostMapping(value = "/init")
    public String init(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.init(hashMap);
    }
    /**
     * @param hashMap 参数
     * @Deprecated 解绑账号
     */
    @PostMapping(value = "/callBack")
    public String callBack(@RequestBody HashMap<String, String> hashMap) {
        return blApiService.callBack(hashMap);
    }


    /**
     * @param hashMap 参数
     * @Deprecated 解绑账号
     */
    @PostMapping(value = "/fuck")
    public String fuck(@RequestBody HashMap<String, String> hashMap) throws Exception {
        try {
            return blApiService.fuck(hashMap);
        }catch (Exception e) {
            return null;
        }
    }

    /**
     * @param hashMap 参数
     * @Deprecated 解绑账号
     */
    @PostMapping(value = "/getDemo")
    public String getIpAddress(@RequestBody HashMap<String, String> hashMap) throws Exception {
        try {
            return blApiService.getDemo(hashMap);
        }catch (Exception e) {
            return null;
        }
    }


}
